package sctu.edu.java.year2016.team01.xuhanmei.day20160618;


import java.io.File;

/**
 * Created by Administrator on 2016/6/18.
 */
public class FileTree {
    public static void main(String[] args) {
        File f=new File("d:/java小程序");
        printFile(f,0);
    }
    public static void printFile(File file,int level){
        for(int i=0;i<level;i++){
            System.out.print("-");
        }
        System.out.println(file.getName());
        if(file.isDirectory()){
            File[] files=file.listFiles();
            for(File temp:files){
                printFile(temp,level+1);
            }
        }
    }
}
